:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --font-size-base: 0.875rem;
    --font-size-sm: 0.75rem;
    --font-size-xs: 0.6875rem;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background-color: #fff;
    color: #333;
    border-left: 5px solid #0d6efd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    z-index: 1000;
    display: none;
    font-size: var(--font-size-base);
    max-width: 400px;
    word-wrap: break-word;
    animation: fadeIn 0.3s, fadeOut 0.3s 1.2s;
}

@keyframes fadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

@keyframes fadeOut {
    from {opacity: 1; transform: translateY(0);}
    to {opacity: 0; transform: translateY(-20px);}
}

body.dark-theme .notification {
    background-color: #1e1e1e;
    color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: #4d9eff;
}

/* 基础卡片样式 */
.card {
    margin-bottom: 0.5rem !important;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 10px;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 8px 12px;
    font-size: var(--font-size-base);
}

.card-header h5 {
    font-size: var(--font-size-base);
}

.card-body {
    padding: 0.5rem;
}

/* 表格样式 */
.table th, .table td {
    padding: 0.25rem 0.5rem;
    font-size: var(--font-size-sm);
}

.table th {
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.table-container {
    height: calc(100vh - 200px);
    overflow-y: auto;
}

.table-container thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #2d2d2d;
}

/* 深色主题样式 */
body.dark-theme {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-theme .card {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-theme .table {
    color: #e0e0e0;
}

body.dark-theme .table-striped>tbody>tr:nth-of-type(odd)>* {
    color: #e0e0e0;
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme .table-striped>tbody>tr:nth-of-type(even)>* {
    color: #e0e0e0;
    background-color: transparent;
}

body.dark-theme .table-hover>tbody tr:hover>* {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.075);
}

body.dark-theme .table-dark {
    --bs-table-bg: #2d2d2d;
    --bs-table-striped-bg: #343434;
    --bs-table-striped-color: #fff;
    --bs-table-active-bg: #373b3e;
    --bs-table-active-color: #fff;
    --bs-table-hover-bg: #323539;
    --bs-table-hover-color: #fff;
    color: #fff;
    border-color: #373b3e;
}

body.dark-theme .table-container thead th {
    background-color: #2d2d2d;
}

/* 文本颜色样式 */
.text-success {
    color: #198754 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-muted {
    color: #6c757d !important;
}

body.dark-theme .text-success {
    color: #75b798 !important;
}

body.dark-theme .text-danger {
    color: #ea868f !important;
}

body.dark-theme .text-warning {
    color: #ffda6a !important;
}

body.dark-theme .text-muted {
    color: #a7acb1 !important;
}

/* 按钮样式 */
.btn {
    font-size: var(--font-size-sm);
    padding: 0.25rem 0.5rem;
}

.btn i {
    font-size: 0.8rem;
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-connected {
    background-color: #198754;
}

.status-disconnected {
    background-color: #dc3545;
}

.status-unknown {
    background-color: #6c757d;
}

body.dark-theme .status-connected {
    background-color: #75b798;
}

body.dark-theme .status-disconnected {
    background-color: #ea868f;
}

body.dark-theme .status-unknown {
    background-color: #a7acb1;
}

/* 点位禁用状态 */
.point-disabled {
    opacity: 0.6;
}

/* 控制按钮区域 */
.control-buttons {
    margin: 10px 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .table th, .table td {
        padding: 0.2rem 0.3rem;
        font-size: var(--font-size-xs);
    }
    
    .btn {
        padding: 0.2rem 0.4rem;
        font-size: var(--font-size-xs);
    }
    
    .card-header {
        padding: 0.4rem 0.6rem;
    }
}

/* 模态框样式 */
.modal-content {
    border-radius: 6px;
}

body.dark-theme .modal-content {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

body.dark-theme .modal-header {
    border-bottom: 1px solid #444;
}

body.dark-theme .modal-footer {
    border-top: 1px solid #444;
}

/* 表单样式 */
.form-label {
    font-size: var(--font-size-sm);
    margin-bottom: 0.25rem;
}

.form-control {
    font-size: var(--font-size-sm);
    padding: 0.25rem 0.5rem;
}

.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

body.dark-theme .form-control {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-theme .form-control:focus {
    border-color: #4d9eff;
    box-shadow: 0 0 0 0.25rem rgba(77, 158, 255, 0.25);
}

/* 主题切换按钮 */
.theme-switcher .btn {
    font-size: var(--font-size-xs);
    padding: 0.2rem 0.4rem;
}